---
#os
os_type: x86_64
os_ssh_port: 22
os_general_user: shsnc
os_general_group: "{{ '{{ os_general_user }}' }}"
#若是更新,需要echo 'newpwd' | openssl passwd -1 -stdin,替换common\deploy\roles\inithost\tasks\main.yml
os_general_pwd: 6a1dHiY3XNl!
#部署根目录
snc_home_path: /home/{{ '{{ os_general_user }}' }}/snc_product

#------------------- 组件配置，默认不用修改 ----------------------#
open_middle_path: /root/playbookV2/common/open_middle
release_version: 7
jdk_home: "{{ '{{ snc_home_path }}' }}/jdk"
jar_home: "{{ '{{ snc_home_path }}' }}/product"

{# 根据 groups 字典中是否存在 'nginx' 键来判断是否渲染此部分 #}
{% if 'nginx' in groups %}
#nginx
nginx_port: 8080
nginx_ip: '{{ hostvars["nginx_node1"].ansible_host }}'
nginx_addr: '{{ hostvars["nginx_node1"].addr }}'
nginx_run_user: "{{ '{{ os_general_user }}' }}"
nginx_run_group: "{{ '{{ os_general_group }}' }}"
nginx_basedir: "{{ '{{ snc_home_path }}' }}/nginx"
nginx_mode: '{{ hostvars["nginx_node1"].nginx_mode }}'

#sftp
sftp_ip: '{{ hostvars["nginx_node1"].ansible_host }}'
sftp_port: "{{ '{{ os_ssh_port }}' }}"
sftp_user: "{{ '{{ os_general_user }}' }}"
sftp_pwd: "{{ '{{ os_general_pwd }}' }}"
sftp_en_user: ENC(dnduzut8HgW8E0oENwkeJg==)
sftp_en_pwd: ENC(k3DKVvAm9GrXzub5pqv5B7hVevx8yF+7)
sftp_path: "{{ '{{ snc_home_path }}' }}/sftp"
sftp_path_script: "{{ '{{ sftp_path }}' }}/script"
sftp_path_validate: "{{ '{{ sftp_path }}' }}/validate"
{% endif %}

{% if 'minio' in groups %}
#minio
minio_ip: '{{ hostvars["minio_node1"].ansible_host }}'
minio_addr: '{{ hostvars["minio_node1"].addr }}'
minio_console_port: 9001
minio_address_port: 40169
minio_access_key: minioadmin
minio_secret_key: Bbbe05FkQ5F@
minio_access_en_key: ENC(pOswWNLBmVs2r4OR3SO6I3zuIHj4AAOC)
minio_secret_en_key: ENC(bAQKOIAYquCmzaq5u8b2SqBpGoP975vV)
minio_mode: '{{ hostvars["minio_node1"].minio_mode }}'
{% endif %}

{% if 'mysql' in groups %}
#mysql
mysql_ip: '{{ hostvars["mysql_node1"].ansible_host }}'
mysql_addr: '{{ hostvars["mysql_node1"].addr }}'
mysql_basedir: "{{ '{{ snc_home_path }}' }}/mysql"
mysql_datadir: "{{ '{{ snc_home_path }}' }}/mysql/data"
mysql_port: 3306
mysql_run_user: "{{ '{{ os_general_user }}' }}"
mysql_run_group: "{{ '{{ os_general_group }}' }}"
mysql_db_user: shsnc
mysql_db_pwd: d5LCfkS#2KE5
mysql_db_root_user: root
mysql_db_root_pwd: Nu0Knj3Cqn!Q
mysql_db_en_user: ENC(eH+kMNbdzjIrmuBq+2tDHw==)
mysql_db_en_pwd: ENC(zNf9Ih9h8mCj93wvK+dIm+OQLQeQAwVG)
mysql_db_en_root_user: ENC(tYtt0NqiZU4MyLj1v5f/cg==)
mysql_db_en_root_pwd: ENC(zXM/nMZYElHTxH3XrZUdK86K9YYSBUpE)
mysql_mode: '{{ hostvars["mysql_node1"].mysql_mode }}'
{% endif %}

{% if 'elasticsearch' in groups %}
#elasticsearch
es_node1_ip: "{{hostvars['elasticsearch_node1'].ansible_host}}"
es_addr: "{{hostvars['elasticsearch_node1'].addr}}"
es_basedir: "{{ '{{ snc_home_path }}' }}/elasticsearch"
es_datadir: "{{ '{{ snc_home_path }}' }}/elasticsearch/data"
es_xpack_user: elastic
es_xpack_pwd: Elastic#9200
es_xpack_en_user: ENC(Du+qIvKeE3dgfPZOEds4kA==)
es_xpack_en_pwd: ENC(zBo0PwBidrjUw6WjbEt5q8LEnLwsq0ix)
es_cluster_name: shsnc
es_http_port: 9200
es_transport_port: 9300
es_mode: '{{ hostvars["elasticsearch_node1"].es_mode }}'
{% endif %}

{% if 'kibana' in groups %}
#kibana
kibana_ip: "{{ hostvars['kibana_node1'].ansible_host }}"
kibana_addr: "{{hostvars['kibana_node1'].addr}}"
kibana_port: 5601
kibana_runuser: "{{ '{{ os_general_user }}' }}"
kibana_rungroup: "{{ '{{ os_general_group }}' }}"
kibana_es_url: "http://{{ '{{ es_node1_ip }}' }}:{{ '{{ es_http_port }}' }}"
kibana_es_username: "{{ '{{ es_xpack_user }}' }}"
kibana_es_password: "{{ '{{ es_xpack_pwd }}' }}"
kibana_basedir: "{{ '{{ snc_home_path }}' }}/kibana"
kibana_mode: '{{ hostvars["kibana_node1"].kibana_mode }}'
{% endif %}

{% if 'nacos' in groups %}
#nacos
nacos_ip: "{{hostvars['nacos_node1'].ansible_host}}"
nacos_addr: "{{hostvars['nacos_node1'].addr}}"
nacos_port: 8848
nacos_basedir: "{{ '{{ snc_home_path }}' }}/nacos"
nacos_datadir: "{{ '{{ snc_home_path }}' }}/nacos/data"
nacos_pwd: X9aBES1Sa@TN
nacos_en_pwd: ENC(2o7cCr4WWux3G4sehizdA5wIODap9z4D)
dbname_nacos: nacos
nacos_mode: '{{ hostvars["nacos_node1"].nacos_mode }}'
{% endif %}

{% if 'redis' in groups %}
#redis
redis_ip: "{{hostvars['redis_node1'].ansible_host}}"
redis_addr: "{{hostvars['redis_node1'].addr}}"
redis_basedir: "{{ '{{ snc_home_path }}' }}/redis"
redis_datadir: "{{ '{{ snc_home_path }}' }}/redis/data"
redis_port: 6379
redis_pwd: k4kcOrKvqtr!
redis_en_pwd: ENC(vWaE0YfCvzekP4EVRKBwboHaWvWXuOl6)
redis_mode: '{{ hostvars["redis_node1"].redis_mode }}'
{% endif %}

{% if 'zookeeper' in groups %}
#zookeeper
zookeeper_ip: "{{hostvars['zookeeper_node1'].ansible_host}}"
zookeeper_addr: "{{hostvars['zookeeper_node1'].addr}}"
zookeeper_basedir: "{{ '{{ snc_home_path }}' }}/zookeeper"
zookeeper_datadir: "{{ '{{ snc_home_path }}' }}/zookeeper/data"
zookeeper_port: 2181
zookeeper_admin_port: 12181
zookeeper_pwd: admin:r-lIY]%todIf
zookeeper_en_pwd: ENC(o4vaSl+wItC7DWn9OmyqV46cGFUrFhaSclxsjpHncL4=)
zookeeper_mode: '{{ hostvars["zookeeper_node1"].zookeeper_mode }}'
{% endif %}

{% if 'kafka' in groups %}
#kafka
kafka_ip: "{{hostvars['kafka_node1'].ansible_host}}"
kafka_addr: "{{hostvars['kafka_node1'].addr}}"
kafka_basedir: "{{ '{{ snc_home_path }}' }}/kafka"
kafka_datadir: "{{ '{{ snc_home_path }}' }}/kafka/data"
kafka_port: 9092
kafka_num_partitions: 3
kafka_log_retention_hours: 72
kafka_zk_connect: "{{ '{{ zookeeper_addr }}' }}"
kafka_mode: '{{ hostvars["kafka_node1"].kafka_mode }}'
{% endif %}

{% if 'clickhouse' in groups %}
#clickhouse
ck_ip: "{{hostvars['clickhouse_node1'].ansible_host}}"
ck_addr: "{{hostvars['clickhouse_node1'].addr}}"
ck_datadir: '/data/clickhouse'
ck_version: 25.3.1.2703
ck_http_port: 8123
ck_tcp_port: 9000
ck_default_database: snc_aiops_performance
ck_default_password: uc3i5n_owB!J
ck_default_en_password: ENC(H9KKckoG4skn4Jtjm1QyTGtkfrrvHrIS)
ck_memory_limit_percent: 80
#1:single | 3:cluster_3shards_1replicas
#4:cluster_2shards_2replicas | 6:cluster_3shards_2replicas
ck_cluster_name: single
ck_keeper_port: 9181
ck_backups_to_keep_local: 1
ck_backups_username: default
ck_mode: '{{ hostvars["clickhouse_node1"].ck_mode }}'
{% endif %}

{% if 'hadoop' in groups %}
#hadoop
hadoop_master_ip: "{{hostvars['hadoop_node1'].ansible_host}}"
hadoop_master_hostname: "{{hostvars['hadoop_node1'].hostname}}"
hadoop_zk_addr: "{{ '{{ zookeeper_addr }}' }}"
hadoop_basedir: "{{ '{{ snc_home_path }}' }}/hadoop"
hadoop_datadir: "{{ '{{ snc_home_path }}' }}/hadoop/data"
# 设置为CPU核数，会自动×3
hadoop_vcore: 32
# nodemanager能够申请的最大内存,设置为单台内存总数，单位GB
hadoop_vmemory: 60
hadoop_mode: '{{ hostvars["hadoop_node1"].hadoop_mode }}'
{% endif %}
